package org.onion.pattern.notify.dingtalk.msg;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

@Data
public class MsgAt {

    private List<String> atMobiles;

    private List<String> atUserIds;

    private Boolean isAtAll;

    public MsgAt appendMobile(String mobile) {
        if (StringUtils.isBlank(mobile)) {
            return this;
        }
        if (atMobiles == null) {
            atMobiles = new ArrayList<>();
        }
        atMobiles.add(mobile);
        return this;
    }


    public MsgAt appendUserId(String userId) {
        if (StringUtils.isBlank(userId)) {
            return this;
        }
        if (atUserIds == null) {
            atUserIds = new ArrayList<>();
        }
        atUserIds.add(userId);
        return this;
    }


}
